<table class="user-info">
    <tr>
        <td class="title">旧密码</td>
        <td class="field">
            <input type="password" class="admin_input ui_password_old" value="" placeholder="请输入旧的登录密码">
        </td>
        <td class="copy"></td>
    </tr>

    <tr>
        <td class="title">新密码</td>
        <td class="field">
            <input type="password" class="admin_input ui_p1" value="" placeholder="请输入新的登录密码">
        </td>
        <td class="copy"></td>
    </tr>

    <tr>
        <td class="title">确认密码</td>
        <td class="field">
            <input type="password" class="admin_input ui_p2" value="" placeholder="请再次输入新的登录密码">
        </td>
        <td class="copy"></td>
    </tr>
</table>

<div class="button_line">
    <button class="btn-save common_button admin_button">修改</button>
    <button class="close common_button admin_button">关闭</button>
</div>

<script>
    $(".close").click(function() {
        $("#modify_password").remove();
    });
    $(".btn-save").click(function() {
        var p0 = $(".ui_password_old").val().trim();
        var p1 = $(".ui_p1").val().trim();
        var p2 = $(".ui_p2").val().trim(); 
        if (p0 == '') {
            alert2("请输入旧的登录密码！", true);
            return;
        }
        if (p1 == '') {
            alert2("请输入新的登录密码！", true);
            return;
        }
        if (p2 == '') {
            alert2("请再次输入登录密码！", true);
            return;
        }
        if (p1 != p2) {
            alert2("两次登录密码不一致！", true);
            return;
        }
        startLoading();
        CMD.modify_password(p1, p0, function() {
            stopLoading();
            alert2("修改成功！");
            $("#modify_password").remove();
        }, function(message) {
            stopLoading();
            if (message) alert2(message);
        });
    });
    $("select").selected();
</script>